package nl.vu.few.ibivu.biomodels.client.ui.base;

import com.smartgwt.client.widgets.events.MouseOverEvent;
import com.smartgwt.client.widgets.events.MouseOverHandler;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.toolbar.ToolStripMenuButton;

public class OverMenuButton extends ToolStripMenuButton {

	public OverMenuButton(String title, Menu menu) {
		super(title, menu);
		
		this.setShowMenuButtonImage(false);
		this.setMenuAnimationEffect("fade");
		this.addMouseOverHandler(new MouseOverHandler(){

			@Override
			public void onMouseOver(MouseOverEvent event) {
				Menu menu = getMenu();
				if (menu == null)
					return;
				menu.showNextTo(OverMenuButton.this, "bottom");
			}});
		
	}

}
